package com.ml.loan.common.constants;


import lombok.Getter;

public class CommonConstant {

    public static final String PROJECT_NAME = "loan-mng";

    public static final String TOKEN = "token";

    public static final String DATA = "data";

    public static final String OK = "OK";

    public static final String APPID = "appId";

    public static final String MASTER = "master";

    public static final String HTTP = "http://";

    public static final String HTTPS = "https://";

    public static final int MASTERID = 1;

    public static final String IP = "ip";

    public static final String DEFAULT_IP = "127.0.0.1";

    public static final String SLASH = "/";

    public static final String COMMA = ",";

    public static final String COLON = ":";

    public static final String SPOT = ".";

    public static final String LINE_THROUGH = "-";

    public static final String UNDERLINE = "_";

    public static final String STATIC_STR = "/static/";

    public static final int SUCCESS = 200;

    public static final int FAIL = 500;

    public static final String IOS = "ios";

    public static final String ANDROID = "android";

    public static final String H5 = "h5";

    public static final String DEV = "dev";

    public static final String TEST = "test";

    public static final String PROD = "prod";

    public static final String REDISSON_PREFIX = "loan_redssion";

    public static final String QUERY_LIMIT_1 = "limit 1";


    /**
     * 通用有效/无效状态
     *
     * @Author Mickey
     * @Date 2021/2/27 10:34
     **/
    public enum VALID_STATE {
        //
        VALID(1, "有效"), INVALID(0, "无效");
        @Getter
        private Integer state;
        @Getter
        private String name;

        VALID_STATE(Integer state, String name) {
            this.state = state;
            this.name = name;
        }
    }

    /**
     * 通用boolean状态
     *
     * @author caozx
     * @date 2021/4/12 14:19
     **/
    public enum BOOLEAN_STATE {
        //
        TRUE(1, "是"), FALSE(0, "否");
        @Getter
        private Integer state;
        @Getter
        private String name;

        BOOLEAN_STATE(Integer state, String name) {
            this.state = state;
            this.name = name;
        }
    }


    /**
     * 通用返回结果key常量
     */
    public interface COMMON_RESP {
        String DATA = "data";
        String CODE = "code";
        String MSG = "msg";
        String SUCCESS = "success";
        String RESULT = "result";
        String URL = "url";
        String STATUS = "status";
        String CODE_200 = "200";
        String CODE_500 = "500";
    }

    /**
     * 设备类型 1android 2ios
     **/
    public enum OS_TYPE {
        //
        android(1, "android"), ios(2, "ios");
        @Getter
        private Integer state;
        @Getter
        private String name;

        OS_TYPE(Integer state, String name) {
            this.state = state;
            this.name = name;
        }
    }

}
